from selenium import webdriver
from time import sleep
from selenium.webdriver.common.by import By

from chromeDriver import driver
# 打开留言板页
driver.get("http://127.0.0.1/upload/message.php")
# 输入电子邮件地址
driver.find_element(By.XPATH,"//tr[td='电子邮件地址']/td[2]/input").send_keys("abcd@123.com")
# 点击投诉
driver.find_element(By.XPATH,"//input[@name='msg_type'][@value='1']").click()
sleep(1)
# 点击售后
driver.find_element(By.XPATH,"//input[@name='msg_type' and @value='3']").click()
# 点击报价单
driver.find_element(By.XPATH,"//li[@id='topNav']/a[last()]").click()
# 点击标签云
driver.find_element(By.XPATH,"//li[@id='topNav']/a[last()-1]").click()
# 点击高级搜索
driver.find_element(By.XPATH,"//a[text()='高级搜索']").click()
# 点击登录
driver.find_element(By.XPATH,"//font[contains(text(),'欢迎光临本店')]/a[1]/img").click()
# 点击高级搜索
driver.find_element(By.XPATH,"//a[contains(text(),'高级')]").click()
# 点击注册
driver.find_element(By.XPATH,"//img[contains(@src,'bnt_reg')]").click()
# 练习：点击左上角ECShop商标，要求用它自己的属性找它
driver.find_element(By.XPATH,"//img[contains(@src,'logo')]").click()
# 练习：点击高级搜索，要求用它自己的属性找它
# driver.find_element(By.XPATH,"//a[contains(@href,'advanced')]").click()
sleep(13)
driver.find_element(By.XPATH,"//div[@id='search']//a").click()
sleep(13)
# driver.quit()
